<?php


// AUTO LOADING FUNCTION
function layered_autoload($class)
{
	$len = strlen('Layered');
	if (substr($class, 0, $len) == 'Layered') {
		$file = dirname(__FILE__) . '/' . str_replace('_', '/', substr($class, $len)) . '.php';
		if (file_exists($file)) {
			require_once $file;
		}
	}
}

spl_autoload_register('layered_autoload');


// REST SERVER
$server = new Layered_Rest_Server();
//$server->refreshCache();
$server->addClass('Layered_Controller_Template');
$server->addClass('Layered_Controller_User');

$server->handle();
